package com.ycz.sas.jgen.main;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ycz.sas.jgen.dao.BaseDAO;

public class Test {

	public static void main(String[] args) throws SQLException {
		AbstractApplicationContext context = new ClassPathXmlApplicationContext("Spring_Module.xml");
    	BaseDAO obj = (BaseDAO) context.getBean("jdbcDAO");
    	ResultSet set = obj.executeQuery("select count(1) cc from t_pm_user");
    	if(set.next())
    		System.out.println(set.getInt("cc"));
    	
    	set.getStatement().close();
    	set.getStatement().getConnection().close();
	}
}
